<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Robocup-denayer-project-a: read-only/trunk/source/movingObject/waypoint.cpp Bron Bestand</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Gegenereerd door Doxygen 1.7.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Zoeken');
--></script>
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Hoofd&nbsp;Pagina</span></a></li>
      <li><a href="annotated.html"><span>Klassen</span></a></li>
      <li class="current"><a href="files.html"><span>Bestanden</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
          <span class="left">
            <form id="FSearchBox" action="search.php" method="get">
              <img id="MSearchSelect" src="search/mag.png" alt=""/>
              <input type="text" id="MSearchField" name="query" value="Zoeken" size="20" accesskey="S" 
                     onfocus="searchBox.OnSearchFieldFocus(true)" 
                     onblur="searchBox.OnSearchFieldFocus(false)"/>
            </form>
          </span><span class="right"></span>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&nbsp;Lijst</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>read-only/trunk/source/movingObject/waypoint.cpp</h1>  </div>
</div>
<div class="contents">
<a href="waypoint_8cpp.html">Ga naar de documentatie van dit bestand.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;<a class="code" href="waypoint_8h.html">waypoint.h</a>&quot;</span>
<a name="l00012"></a>00012 <span class="keyword">using namespace </span>std;
<a name="l00013"></a>00013 
<a name="l00014"></a><a class="code" href="class_way_point.html#a0388a615719454d38b5a8160d8058550">00014</a> <a class="code" href="class_way_point.html#a0388a615719454d38b5a8160d8058550">WayPoint::WayPoint</a>()
<a name="l00015"></a>00015 {
<a name="l00016"></a>00016     this-&gt;<a class="code" href="class_way_point.html#a89c261b669af94fe8b51903d1337f972" title="Zet X-coordinaat.">setX</a>(0);
<a name="l00017"></a>00017     this-&gt;<a class="code" href="class_way_point.html#a4fb0098a46a3a5e3110820c3647f9f00">setY</a>(0);
<a name="l00018"></a>00018     this-&gt;<a class="code" href="class_way_point.html#ae453bbb3f53e6f4617abada193b6340d" title="Zet de hoek in radialen.">setTheta</a>(0);
<a name="l00019"></a>00019     this-&gt;<a class="code" href="class_way_point.html#afc01e1562e1a7c08d002d49676dc0596">setTimeStamp</a>(0);
<a name="l00020"></a>00020     this-&gt;<a class="code" href="class_way_point.html#af2ad225a57782b3e0cb1871a2ce7ad58">setKick</a>(<span class="keyword">false</span>);
<a name="l00021"></a>00021 }
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 
<a name="l00024"></a><a class="code" href="class_way_point.html#a42bd16de5b8b3e315cb41c6d77949b1a">00024</a> <a class="code" href="class_way_point.html#a0388a615719454d38b5a8160d8058550">WayPoint::WayPoint</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">float</span> theta, <span class="keywordtype">double</span> timestamp)
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026     this-&gt;<a class="code" href="class_way_point.html#a89c261b669af94fe8b51903d1337f972" title="Zet X-coordinaat.">setX</a>(x);
<a name="l00027"></a>00027     this-&gt;<a class="code" href="class_way_point.html#a4fb0098a46a3a5e3110820c3647f9f00">setY</a>(y);
<a name="l00028"></a>00028     this-&gt;<a class="code" href="class_way_point.html#ae453bbb3f53e6f4617abada193b6340d" title="Zet de hoek in radialen.">setTheta</a>(theta);
<a name="l00029"></a>00029     this-&gt;<a class="code" href="class_way_point.html#afc01e1562e1a7c08d002d49676dc0596">setTimeStamp</a>(timestamp);
<a name="l00030"></a>00030 }
<a name="l00031"></a>00031 
<a name="l00032"></a><a class="code" href="class_way_point.html#acb5d912197e2371772213fe2e1723316">00032</a> <a class="code" href="class_way_point.html#acb5d912197e2371772213fe2e1723316">WayPoint::~WayPoint</a>()
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034 }
<a name="l00035"></a>00035 
<a name="l00040"></a><a class="code" href="class_way_point.html#a89c261b669af94fe8b51903d1337f972">00040</a> <span class="keywordtype">void</span> <a class="code" href="class_way_point.html#a89c261b669af94fe8b51903d1337f972" title="Zet X-coordinaat.">WayPoint::setX</a>(<span class="keywordtype">int</span> x)
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042         x_=x;
<a name="l00043"></a>00043 }
<a name="l00044"></a>00044 
<a name="l00048"></a><a class="code" href="class_way_point.html#af8e925a0c05154820837e21852cf08a5">00048</a> <span class="keywordtype">int</span> <a class="code" href="class_way_point.html#af8e925a0c05154820837e21852cf08a5" title="Get X-coordinaat.">WayPoint::getX</a>()
<a name="l00049"></a>00049 {
<a name="l00050"></a>00050         <span class="keywordflow">return</span> x_;
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052 
<a name="l00053"></a><a class="code" href="class_way_point.html#a4fb0098a46a3a5e3110820c3647f9f00">00053</a> <span class="keywordtype">void</span> <a class="code" href="class_way_point.html#a4fb0098a46a3a5e3110820c3647f9f00">WayPoint::setY</a>(<span class="keywordtype">int</span> y)
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055         y_=y;
<a name="l00056"></a>00056 }
<a name="l00057"></a>00057 
<a name="l00058"></a><a class="code" href="class_way_point.html#abf3b2046af024d6b2c50aacc82175b05">00058</a> <span class="keywordtype">int</span> <a class="code" href="class_way_point.html#abf3b2046af024d6b2c50aacc82175b05">WayPoint::getY</a>()
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060         <span class="keywordflow">return</span> y_;
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062 
<a name="l00067"></a><a class="code" href="class_way_point.html#ae453bbb3f53e6f4617abada193b6340d">00067</a> <span class="keywordtype">void</span> <a class="code" href="class_way_point.html#ae453bbb3f53e6f4617abada193b6340d" title="Zet de hoek in radialen.">WayPoint::setTheta</a>(<span class="keywordtype">float</span> theta)
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069         theta_=theta;
<a name="l00070"></a>00070 }
<a name="l00071"></a>00071 
<a name="l00076"></a><a class="code" href="class_way_point.html#a4e0114e5291cc0039c6a5b505d0103cd">00076</a> <span class="keywordtype">float</span> <a class="code" href="class_way_point.html#a4e0114e5291cc0039c6a5b505d0103cd">WayPoint::getTheta</a>()
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078         <span class="keywordflow">return</span> theta_;
<a name="l00079"></a>00079 }
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 
<a name="l00086"></a><a class="code" href="class_way_point.html#afc01e1562e1a7c08d002d49676dc0596">00086</a> <span class="keywordtype">void</span> <a class="code" href="class_way_point.html#afc01e1562e1a7c08d002d49676dc0596">WayPoint::setTimeStamp</a>(<span class="keywordtype">double</span> timestamp)
<a name="l00087"></a>00087 {
<a name="l00088"></a>00088         timestamp_=timestamp;
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090 
<a name="l00091"></a><a class="code" href="class_way_point.html#a20701a3113324659d7f7d71c39d0aa1d">00091</a> <span class="keywordtype">double</span> <a class="code" href="class_way_point.html#a20701a3113324659d7f7d71c39d0aa1d">WayPoint::getTimeStamp</a>()
<a name="l00092"></a>00092 {
<a name="l00093"></a>00093         <span class="keywordflow">return</span> timestamp_;
<a name="l00094"></a>00094 }
<a name="l00095"></a>00095 
<a name="l00096"></a><a class="code" href="class_way_point.html#af2ad225a57782b3e0cb1871a2ce7ad58">00096</a> <span class="keywordtype">void</span> <a class="code" href="class_way_point.html#af2ad225a57782b3e0cb1871a2ce7ad58">WayPoint::setKick</a>(<span class="keywordtype">bool</span> kick)
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098         kick_=kick;
<a name="l00099"></a>00099 }
<a name="l00100"></a>00100 
<a name="l00101"></a><a class="code" href="class_way_point.html#a5be7d844556a50303d9cd51cbfd20e86">00101</a> <span class="keywordtype">bool</span> <a class="code" href="class_way_point.html#a5be7d844556a50303d9cd51cbfd20e86">WayPoint::getKick</a>()
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103         <span class="keywordflow">return</span> kick_;
<a name="l00104"></a>00104 }
<a name="l00105"></a>00105 
<a name="l00106"></a><a class="code" href="class_way_point.html#a8f7c5061da83fb2e8ec02031df768f95">00106</a> <span class="keywordtype">double</span> <a class="code" href="class_way_point.html#a8f7c5061da83fb2e8ec02031df768f95">WayPoint::computeDistance</a>(<a class="code" href="class_way_point.html">WayPoint</a> wp)
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108         <span class="keywordflow">return</span> sqrt((<a class="code" href="class_way_point.html#af8e925a0c05154820837e21852cf08a5" title="Get X-coordinaat.">getX</a>()-wp.<a class="code" href="class_way_point.html#af8e925a0c05154820837e21852cf08a5" title="Get X-coordinaat.">getX</a>())*(<a class="code" href="class_way_point.html#af8e925a0c05154820837e21852cf08a5" title="Get X-coordinaat.">getX</a>()-wp.<a class="code" href="class_way_point.html#af8e925a0c05154820837e21852cf08a5" title="Get X-coordinaat.">getX</a>()) + (<a class="code" href="class_way_point.html#abf3b2046af024d6b2c50aacc82175b05">getY</a>()-wp.<a class="code" href="class_way_point.html#abf3b2046af024d6b2c50aacc82175b05">getY</a>())*(<a class="code" href="class_way_point.html#abf3b2046af024d6b2c50aacc82175b05">getY</a>()-wp.<a class="code" href="class_way_point.html#abf3b2046af024d6b2c50aacc82175b05">getY</a>()));
<a name="l00109"></a>00109 }
<a name="l00110"></a>00110 
<a name="l00111"></a>00111 
<a name="l00112"></a><a class="code" href="class_way_point.html#a8c27ff73f69413e24a50f45777835605">00112</a> <span class="keywordtype">void</span> <a class="code" href="class_way_point.html#a8c27ff73f69413e24a50f45777835605">WayPoint::Properties</a>()
<a name="l00113"></a>00113 {
<a name="l00114"></a>00114         cout &lt;&lt; <span class="stringliteral">&quot;\nCharacteristics of this WayPoint&quot;</span>;
<a name="l00115"></a>00115         cout &lt;&lt; <span class="stringliteral">&quot;\nx   = &quot;</span> &lt;&lt; <a class="code" href="class_way_point.html#af8e925a0c05154820837e21852cf08a5" title="Get X-coordinaat.">getX</a>();
<a name="l00116"></a>00116         cout &lt;&lt; <span class="stringliteral">&quot;\ny   = &quot;</span> &lt;&lt; <a class="code" href="class_way_point.html#abf3b2046af024d6b2c50aacc82175b05">getY</a>();
<a name="l00117"></a>00117         cout &lt;&lt; <span class="stringliteral">&quot;\ntheta = &quot;</span> &lt;&lt; <a class="code" href="class_way_point.html#a4e0114e5291cc0039c6a5b505d0103cd">getTheta</a>();
<a name="l00118"></a>00118         cout &lt;&lt; <span class="stringliteral">&quot;\ntimestamp = &quot;</span> &lt;&lt; <a class="code" href="class_way_point.html#a20701a3113324659d7f7d71c39d0aa1d">getTimeStamp</a>();
<a name="l00119"></a>00119         cout &lt;&lt; <span class="stringliteral">&quot;\nkick = &quot;</span> &lt;&lt; <a class="code" href="class_way_point.html#a5be7d844556a50303d9cd51cbfd20e86">getKick</a>() &lt;&lt; endl;
<a name="l00120"></a>00120 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Gegenereerd op Do 19 Mei 2011 10:15:28 voor Robocup-denayer-project-a door&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
